package com.books.service.admin;

import com.books.model.entity.backcontroller.Admin;
import com.books.model.entity.backcontroller.Announcement;
import com.books.model.entity.backcontroller.Chat;
import com.books.model.entity.backcontroller.Vip;
import com.books.model.entity.address.Receiving_address;
import com.books.model.entity.back.Back;
import com.books.model.entity.book.BookType;
import com.books.model.entity.book.Books;
import com.books.model.entity.book.Ebook;
import com.books.model.entity.common.People;
import com.books.model.entity.order.BuyOrder;
import com.books.model.entity.order.OrderList;
import com.books.model.tool.Data;
import com.books.model.tool.MonthPriceTool;

import java.util.List;

/**
 * @Author 饿熊的咆哮
 * @Date 2021/9/26 20:40
 * @Version 1.0
 */

public interface IAdminService {

    //获取EChat图的data数据
    List<Data> findVipNum();
    List<MonthPriceTool> getMonthMoney();


    //操作管理员
    List<Admin> findAll();
    Admin findAdminByPeopleId(Integer peopleId);
    Admin findByAccount(String account);
    Admin findByAdminId(Integer adminId);
    List<Admin> findByNickName(String nickName);
    void updateByAccount(Admin admin,String account);
    boolean delByAdminId(Integer adminId);
    void addAdmin(Admin admin);

    // 操作书籍类别
    List<BookType> findAllBookCategory();
    BookType findByCategoryName(String categoryName);
    BookType findByBookTypeId(int typeId);

    //操作所有人员
    List<People> findAllPeople();
    People findByPhone(String phone);
    People findByPeopleId(Integer peopleId);
    List<People> findByPeople(People people);
    void addPeople(People people);
    void updateByPeopleId(People people,Integer peopleId);
    void delByPeopleId(Integer peopleId);

    //操作vip
    List<Vip> findAllVip();
    Vip findByVipId(Integer vipId);
    List<Vip> findByVipName(String vipName);
    void addVip(Vip vip);
    void updateVip(Vip vip,Integer vipId);

    //操作公告
    List<Announcement> findAllAnnouncement();
    List<Announcement> findByAnnouncement(Announcement announcement);
    void addAnnouncement(Announcement announcement);
    void delByAnnouncementId(Integer announcementId);

    //操作聊天
    List<Chat> findChatByTake(Integer takePeopleId);
    List<Chat> findRead(Integer takePeopleId,boolean ifRead);
    List<Chat> findHistoryChat(Integer adminPeopleId,Integer userPeopleId);
    void addChat(Chat chat);
    void delChat(Integer peopleId);
    void updateChat(boolean ifRead,Integer chatId);

    //操作用户
    List<People> findUser();
    String findStatus(Integer statusId);
    Integer findStatusId(String status);
    void updateVipIntegral(Double vipIntegral,Integer vipId,Integer peopleId);
    List<People> findUserByPeople(People people);
    List<Receiving_address> findAllAddress(int people_id);

    //操作书籍
    List<Books> findAllBook();
    Books findByBookId(Integer bookId);
    // List<Books> findByBookName(String title);
    // List<Books> findByAuthor(String author);
    // List<Books> findByBookType(String category);
    List<Books> findByBook(Books books);
    void delByBkId(Integer bkId);
    void updateBook(Integer bkId,Double price);
    void updateBookStock(Integer bkId,Integer stock);
    void addBook(Books book);

    //操作电子书
    List<Ebook> findAllEBook();
    Ebook findByEBookId(Integer EbookId);
    List<Ebook> findByEBook(Ebook ebook);
    void delByEBkId(Integer ebkId);
    void updateEBook(Integer ebkId,Double price);
    void addEBook(Ebook ebook);

    //操作订单
    List<BuyOrder> getAllOrders();
    List<BuyOrder> findBy(BuyOrder buyOrder);

    //操作订单细明
    List<OrderList> findAllList(String buyId);
    void updateBuyStatus(Integer buyStatus,String id);
    List<OrderList> getAllList();
    OrderList findList(String id);

    //操作退款申请
    List<Back> findAllBack();
    void delByBackId(String orderListId);
}
